<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                template="templates/template.xhtml"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                xmlns:msh="http://java.sun.com/jsf/composite/msh">
    <f:metadata>
        <f:viewParam name="id" value="#{detailController.advId}" valueChangeListener="#{detailController.onReceiveAdvId}"/>
    </f:metadata>
    <ui:define name="title">
        <h:outputText value="#{msgs['detail.title']}"/>
    </ui:define>
    <ui:define name="content">
        <h:form>
            <c:if test="#{!detailController.exists}">
                <div id="welcome_message" class="basic_style_1">
                    <h2 id="welcome_message_title" class="font_cufon"><h:outputText value="#{msgs['detail.error.title']}" escape="false"/></h2>
                    <p><h:outputText value="#{msgs['detail.error.content']}" escape="false"/></p>
                </div>
            </c:if>
            <c:if test="#{detailController.exists}">
                <c:if test="#{detailController.sellingHouse}">
                    <div id="single_page" class="basic_style_1 single_page_mod">
                        <h2 id="single_page_title" class="font_cufon">#{detailController.model.title}</h2>
                        <p class="post_listing_date"><h:outputText value="#{detailController.model.postDate}"><f:convertDateTime dateStyle="default" timeStyle="default" type="both"/></h:outputText> <span>by <a href="#top"><b>#{detailController.model.user.username}</b></a></span></p>
                        <p>
                            <p:lightBox style="text-align:center" rendered="#{not empty detailController.model.imagePath}">
                                <h:outputLink value="#{detailController.model.imagePath}" title="#{detailController.model.title}">
                                    <p:graphicImage url="#{detailController.model.imagePath}" width="400" styleClass="image_excerpt"/>
                                </h:outputLink>
                            </p:lightBox>
                        </p>
                        <p class="description_container"><h:outputText value="#{detailController.model.description}" escape="false"/></p>
                        <p class="post_sub_title"><b>#{detailController.model.sellingHouse.city}</b> | #{detailController.model.sellingHouse.location}</p>
                        <p class="post_adl_info2"><span>#{detailController.model.sellingHouse.houseType.houseTypeName}</span><h:outputFormat value="#{msgs['listing.squareFootage']}"><f:param value="#{detailController.model.sellingHouse.squareFootage}"/></h:outputFormat></p>
                        <p class="post_listing_info font_cufon">#{detailController.model.sellingHouse.noOfBedrooms} #{msgs['listing.bedrooms']} &bull; #{detailController.model.sellingHouse.noOfBathrooms} #{msgs['listing.bathrooms']}</p>
                        <p class="post_listing_price font_cufon">
                            <h:outputText value="#{detailController.model.sellingHouse.price}">
                                <f:convertNumber currencySymbol="$ " type="currency" maxFractionDigits="0"/>
                            </h:outputText>
                            <span class="priceType"><h:outputText value="#{detailController.model.sellingHouse.priceType ? msgs['listing.priceFixed'] : msgs['listing.priceNegotiable']}"/></span>
                            <span class="priceName"><h:outputText value="#{msgs['listing.price']}"/></span></p>
                        <p class="npost_adl_info"><span>#{msgs['listing.contactDetails']}: </span>#{detailController.model.sellingHouse.contactDetails}</p>
                        <table class="tblDetail">
                            <tr><td class="label">#{msgs['listing.extraFacilities']}</td>
                                <td class="value"><msh:outputText value="#{detailController.model.sellingHouse.extraFacilities}"/></td></tr>
                            <tr><td class="label">#{msgs['listing.furniture']}</td>
                                <td class="value"><msh:outputText value="#{detailController.model.sellingHouse.furniture}"/></td></tr>
                            <tr><td class="label">#{msgs['listing.modesOfTransport']}</td>
                                <td class="value"><msh:outputText value="#{detailController.model.sellingHouse.modesOfTransport}"/></td></tr>
                            <tr><td class="label">#{msgs['listing.modeOfPayment']}</td>
                                <td class="value"><msh:outputText value="#{detailController.model.sellingHouse.modeOfPayment}"/></td></tr>
                        </table>
                    </div>
                </c:if>

                <c:if test="#{detailController.rentalBasis}">
                    <div id="single_page" class="basic_style_1 single_page_mod">
                        <h2 id="single_page_title" class="font_cufon">#{detailController.model.title}</h2>
                        <p class="post_listing_date"><h:outputText value="#{detailController.model.postDate}"><f:convertDateTime dateStyle="default" timeStyle="default" type="both"/></h:outputText> <span>by <a href="#top"><b>#{detailController.model.user.username}</b></a></span></p>
                        <p>
                            <p:lightBox style="text-align:center" rendered="#{not empty detailController.model.imagePath}">
                                <h:outputLink value="#{detailController.model.imagePath}" title="#{detailController.model.title}">
                                    <p:graphicImage url="#{detailController.model.imagePath}" width="400" styleClass="image_excerpt"/>
                                </h:outputLink>
                            </p:lightBox>
                        </p>
                        <p class="description_container"><h:outputText value="#{detailController.model.description}" escape="false"/></p>
                        <p class="post_sub_title"><b>#{detailController.model.rentalBasisAccommodation.city}</b> | #{detailController.model.rentalBasisAccommodation.location}</p>
                        <p class="post_listing_info font_cufon">#{detailController.model.rentalBasisAccommodation.noOfBedrooms} #{msgs['listing.bedrooms']} &bull; #{detailController.model.rentalBasisAccommodation.noOfBathrooms} #{msgs['listing.bathrooms']}</p>
                        <p class="post_listing_price font_cufon">
                            <h:outputText value="#{detailController.model.rentalBasisAccommodation.deposit}">
                                <f:convertNumber currencySymbol="$ " type="currency" maxFractionDigits="0"/>
                            </h:outputText>
                            <span class="priceName"><h:outputText value="#{msgs['listing.deposit']}"/></span></p>
                        <p class="post_listing_price font_cufon">
                            <h:outputText value="#{detailController.model.rentalBasisAccommodation.rent}">
                                <f:convertNumber currencySymbol="$ " type="currency" maxFractionDigits="0"/>
                            </h:outputText> / Month
                            <span class="priceName"><h:outputText value="#{msgs['listing.rent']}"/></span></p>
                        <p class="npost_adl_info"><span>#{msgs['listing.contactDetails']}: </span>#{detailController.model.rentalBasisAccommodation.contactDetails}</p>
                        <table class="tblDetail">
                            <tr><td class="label">#{msgs['listing.modeOfPayment']}</td>
                                <td class="value"><msh:outputText value="#{detailController.model.rentalBasisAccommodation.modeOfPayment}"/></td></tr>
                        </table>
                    </div>
                </c:if>

                <c:if test="#{detailController.payingGuest}">
                    <div id="single_page" class="basic_style_1 single_page_mod">
                        <h2 id="single_page_title" class="font_cufon">#{detailController.model.title}</h2>
                        <p class="post_listing_date"><h:outputText value="#{detailController.model.postDate}"><f:convertDateTime dateStyle="default" timeStyle="default" type="both"/></h:outputText> <span>by <a href="#top"><b>#{detailController.model.user.username}</b></a></span></p>
                        <p class="description_container"><h:outputText value="#{detailController.model.description}" escape="false"/></p>
                        <p class="post_sub_title"><b>#{detailController.model.payingGuestAccommodation.city}</b> | #{detailController.model.payingGuestAccommodation.location}</p>
                        <p class="post_listing_price font_cufon">
                            <h:outputText value="#{detailController.model.payingGuestAccommodation.deposit}">
                                <f:convertNumber currencySymbol="$ " type="currency" maxFractionDigits="0"/>
                            </h:outputText>
                            <span class="priceName"><h:outputText value="#{msgs['listing.deposit']}"/></span></p>
                        <p class="post_listing_price font_cufon">
                            <h:outputText value="#{detailController.model.payingGuestAccommodation.rent}">
                                <f:convertNumber currencySymbol="$ " type="currency" maxFractionDigits="0"/>
                            </h:outputText> / Month
                            <span class="priceName"><h:outputText value="#{msgs['listing.rent']}"/></span></p>
                        <p class="npost_adl_info"><span>#{msgs['listing.contactDetails']}: </span>#{detailController.model.payingGuestAccommodation.contactDetails}</p>
                    </div>
                </c:if>
            </c:if>
        </h:form>
    </ui:define>
</ui:composition>




